//
//  JWGRNewTabcell.m
//  test
//
//  Created by 李彦宏 on 2018/3/17.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "JWGRNewTabcell.h"

@implementation JWGRNewTabcell



//类方法快速创建cell
+(instancetype)cellwithTableview:(UITableView *)tableview{
    
    // 1.创建cell
    static NSString *ID = @"cell2";
    JWGRNewTabcell *cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[JWGRNewTabcell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return  cell;
    
}
/**
 *  cell的初始化方法，一个cell只会调用一次
 *  一般在这里添加所有可能显示的子控件，以及子控件的一次性设置
 */
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI控件
        [self setcellUI];
    }
    return self;
}
-(void)setcellUI{
#pragma -mark ———————————研究生cell————————————————————
    UILabel *lb2=[[UILabel alloc] init];

    [lb2 setTextColor:[UIColor blackColor]];
    [lb2 setFont:[UIFont systemFontOfSize:14]];
    lb2.textAlignment=NSTextAlignmentCenter;
    lb2.text=@"史蒂芬金";
    self.GnameL=lb2;
    [self.contentView addSubview:lb2];
    lb2.frame = CGRectMake(0, 7, 75, 30);
    
    UILabel *lb3=[[UILabel alloc] init];
    [lb3 setTextColor:[UIColor blackColor]];
    [lb3 setFont:[UIFont systemFontOfSize:14]];
    lb3.textAlignment=NSTextAlignmentCenter;
    lb3.text=@"史蒂芬金";
    self.Gcollege=lb3;
    [self.contentView addSubview:lb3];
    lb3.frame = CGRectMake(80, 7, ScreenWidth-95, 30);
    
    UILabel *lb6=[[UILabel alloc] init];
    [lb6 setBackgroundColor:[UIColor clearColor]];
    [lb6 setTextColor:[UIColor lightGrayColor]];
    [lb6 setFont:[UIFont systemFontOfSize:16]];
    lb6.textAlignment=NSTextAlignmentLeft;
    lb6.text=@">";
    [self.contentView addSubview:lb6];
    lb6.frame = CGRectMake(ScreenWidth-15,6 , 10, 30);
//    UILabel *lb3=[[UILabel alloc] init];
//    [lb3 setBackgroundColor:[UIColor clearColor]];
//    [lb3 setTextColor:[UIColor blackColor]];
//    [lb3 setFont:[UIFont systemFontOfSize:14]];
//    lb3.textAlignment=NSTextAlignmentCenter;
//    lb3.text=@"15111111111";
//    [self.contentView addSubview:lb3];
//    self.GphoneL=lb3;
//    lb3.frame = CGRectMake(70, 7, (ScreenWidth-120)/2, 30);
//
//    UILabel *lb4=[[UILabel alloc] init];
//    [lb4 setBackgroundColor:[UIColor clearColor]];
//    [lb4 setTextColor:[UIColor blackColor]];
//    [lb4 setFont:[UIFont systemFontOfSize:14]];
//    lb4.textAlignment=NSTextAlignmentCenter;
//    lb4.text=@"20";
//    self.Gjieshu=lb4;
//    [self.contentView addSubview:lb4];
//    lb4.frame = CGRectMake(60+(ScreenWidth-120)/2, 7, (ScreenWidth-120)/2, 30);
//
//    UILabel *lb5=[[UILabel alloc] init];
//    [lb5 setBackgroundColor:[UIColor clearColor]];
//    [lb5 setTextColor:XGColor];
//    [lb5 setFont:[UIFont systemFontOfSize:14]];
//    lb5.textAlignment=NSTextAlignmentCenter;
//    lb5.text=@"否";
//    self.GisNO=lb5;
//    [self.contentView addSubview:lb5];
//    lb5.frame = CGRectMake(ScreenWidth-70, 7, 60, 30);
//

//
}

-(void)setModel:(JWGRUsermodel *)model{
    _model=model;
    self.GnameL.text=_model.name;
    self.Gcollege.text=_model.college;
    if(_model.studentlist.count==0){
        
    self.GnameL.textColor=[UIColor redColor];
        self.Gcollege.textColor=[UIColor redColor];
    }else{
        self.GnameL.textColor=[UIColor blackColor];
        self.Gcollege.textColor=[UIColor blackColor];
    
    }
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
